/*
 * Created on 2005-2-17
 *
 */
package bma.common.langutil.core;

import java.io.Serializable;
import java.text.MessageFormat;

/**
 * @author 关中
 * @since 1.0 (imported from BMA.ESP Project)
 * 
 */
public class ObjectPair<VC, AC> implements Serializable {

	private static final long serialVersionUID = 1L;

	private VC value;

	private AC attribute;

	public ObjectPair() {
		super();
	}

	/**
	 * @param value
	 * @param name
	 */
	public ObjectPair(VC value, AC attri) {
		super();
		this.attribute = attri;
		this.value = value;
	}

	public AC getAttribute() {
		return this.attribute;
	}

	public void setAttribute(AC attri) {
		this.attribute = attri;
	}

	public VC getValue() {
		return this.value;
	}

	public void setValue(VC value) {
		this.value = value;
	}

	public boolean sameAttribute(AC att) {
		return ObjectUtil.equals(this.attribute, att);
	}

	public boolean sameValue(VC v) {
		return ObjectUtil.equals(this.value, v);
	}

	@Override
	public String toString() {
		return MessageFormat.format("{0}:{1}", this.attribute, this.value);
	}

}